(flyspell-correct-word-before-point): Don't let opoint be nil.
authorRichard M. Stallman <rms@gnu.org>
Thu, 24 May 2007 22:11:50 +0000 (22:11 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 24 May 2007 22:11:50 +0000 (22:11 +0000)
(flyspell-emacs-popup): Explicit error if no dialogs.

lisp/textmodes/flyspell.el

index a509fdf7f6c4c3f8661628bab9b3f203ab816163..e02fec1362f0ebdd0ca05fde2f8ef3a160b2cb64 100644 (file)
@@ -2025,6 +2025,7 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement."
     (error "Pop-up menus do not work on this terminal"))
   ;; use the correct dictionary
   (flyspell-accept-buffer-local-defs)
+  (or opoint (setq opoint (point-marker)))
   (let ((cursor-location (point))
        (word (flyspell-get-word nil)))
     (if (consp word)
@@ -2133,6 +2134,8 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement."
 ;;*---------------------------------------------------------------------*/
 (defun flyspell-emacs-popup (event poss word)
   "The Emacs popup menu."
+  (unless window-system
+    (error "This command requires pop-up dialogs"))
   (if (not event)
       (let* ((mouse-pos  (mouse-position))
             (mouse-pos  (if (nth 1 mouse-pos)